<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "me_user_address".
 *
 * @property integer $id
 * @property integer $userid
 * @property string $name
 * @property integer $area
 * @property string $address_detail
 * @property string $note
 * @property string $phone
 * @property string $mobile
 * @property integer $created_at
 * @property integer $updated_at
 */
class UserAddress extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'me_user_address';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['userid', 'name', 'area', 'address_detail', 'phone'], 'required'],
            [['userid', 'area', 'created_at', 'updated_at'], 'integer'],
            [['address_detail'], 'string'],
            [['name'], 'string', 'max' => 50],
            [['note'], 'string', 'max' => 255],
            [['phone', 'mobile'], 'string', 'max' => 30],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'userid' => 'Userid',
            'name' => 'Name',
            'area' => 'Area',
            'address_detail' => 'Address Detail',
            'note' => 'Note',
            'phone' => 'Phone',
            'mobile' => 'Mobile',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }
}
